package com.hui.auth.entity;

import org.hibernate.validator.constraints.NotEmpty;

import java.io.Serializable;
import java.util.List;

/**
 * 角色
 * Created by LiaoYunHui on 2017/9/23/023.
 */
public class AuthRole implements Entity, Serializable {
    @Ignore
    private static final long serialVersionUID = -5809782578272943993L;
    @Ignore
    private long id;
    @NotEmpty(message = "角色名不能为空")
    private String name;
    @Ignore
    private List<AuthMenu> menu;
    @Ignore
    private List<AuthPermission> permission;


    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<AuthMenu> getMenu() {
        return menu;
    }

    public void setMenu(List<AuthMenu> menu) {
        this.menu = menu;
    }

    public List<AuthPermission> getPermission() {
        return permission;
    }

    public void setPermission(List<AuthPermission> permission) {
        this.permission = permission;
    }

    @Override
    public String toString() {
        return "AuthRole{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", menu=" + menu +
                ", permission=" + permission +
                '}';
    }

    @Override
    public String table() {
        return "auth_role";
    }
}
